<template>
	<component :is="current"></component>
</template>

<script>

import LoginView from './views/LoginView.vue' ;
import HomeView from './views/HomeView.vue' ;
	
export default {
	data() {
		return {
			current: "HomeView", 
		}
	},
	components: {
		LoginView, 
		HomeView
	}, 
	watch: {
		"$route": function(route) {
			// 获取当前路由地址，判断是否是 login 路由，如果是，则切换到登录路由
			if (route.path === '/login') {
				this.current = 'LoginView' ;
			}else{
				this.current = 'HomeView' ;
			}
		}
	}
}
</script>

<style>
::-webkit-scrollbar {
  width:5px;
}
::-webkit-scrollbar-track {
  background:#f2f2f2;
}
::-webkit-scrollbar-thumb {
  background:rgba(0,0,0,.2);
}
::-webkit-scrollbar-thumb:hover {
  background:#f2f2f2;
}
::-webkit-scrollbar-thumb:active {
  background:rgba(0,0,0,0.2);
}
</style>

